This application claims priority from JP2004-58964 filed Mar. 3, 2004 herein incorporated by reference in its entirety.
1. Field of the Invention
The present invention relates to an image processing apparatus, method, and program for correcting image data. In particular, the invention relates to an image processing technique which allows appropriate correction or “retouching” of the image data even when a boundary (edge) or pattern portion of a recorded image is present within its defective portion, by appropriately reflecting such boundary, pattern or the like in the correction.
2. Description of the Related Art
A photographic film may include a defective portion on its surface, such as a scar, dust, dirt, etc. Then, when a photographically recorded image is read from such “defective” film to be printed on a print sheet or outputted on a display, there is known a technique available for correcting such defect by means of an image processing operation relying on e.g. a luminance adjustment technique and an interpolating technique.
An exemplary technique is known from Japanese Patent Application “Kokai” No.: 11-98370 (at pages 15-16, FIG. 4 thereof in particular). This technique effects correction by way of luminance adjustment, based on the unique property of infrared beam. Namely, unlike the visible beam, the infrared beam, when irradiated on an exposed photographic film, is hardly affected by a photographic image recorded thereon, but affected only by such physical defect as a scar, dust or the like. Referring more particularly to this technique, both infrared beam and visible beam are irradiated on an exposed photographic film. Then, a portion of the film where a pixel value of infrared image data is below a predetermined threshold is determined as a defective portion. Then, to a pixel value of each color component (red (R), green (G), blue (B)) of this defective portion, a correction value is added as a “gain” which corresponds to an amount of luminance attenuation occurring in the defective portion relative to a normal (non-defective) portion of the film, thereby to positively increase the luminance. In this way, the pixel value of each color component of the defective portion is adjusted or corrected relative to the normal portion by means of luminance enhancement.
However, this luminance adjustment technique is based on an assumption that the pixel values of the respective color components of the defective portion have experienced an equal amount of luminance attenuation. For this reason, if the amounts of attenuation in the pixel values of the respective color components differ from each other as may happen in the case of a scar in an emulsion surface on the film, the above technique cannot correct this defect appropriately.
In such case, an interpolation technique may be employed which corrects the defective portion by utilizing pixel values of non-defective, i.e. normal pixels adjacent thereto as reference values for the defect correction. However, if the defective portion includes a boundary (edge) or a pattern of the photographic image recorded on the film, such defective portion cannot be properly corrected by the above technique if it simply applies pixel values of adjacent non-defective pixels to the defective portion for its correction. In an attempt to cope with this problem, there has been proposed a further technique known from e.g. Japanese Patent Application “Kokai” No. 2001-78038 (in particular, at pages 7-8, FIGS. 4-5 and FIG. 8), which detects a direction along which the image boundary is present and then effects the interpolation along that detected direction. More particularly, along a plurality of differing directions from the defective portion, the technique calculates image “attribute” values such as a density gradient of the normal pixels, a distance between the normal pixels, etc. Then, for each of the plural directions, based on the data of normal pixels present along a predetermined direction relative to the defective portion on the image, a correction value for correcting the defective portion is obtained by interpolation. Thereafter, based on the calculated image attribute values and the correction values calculated for the respective directions, a final correction value is obtained and used for correcting the defective portion.
Yet, this conventional interpolation correction technique exemplified by the Japanese Patent Application “Kokai” No. 2001-78038 discussed above still suffers a problem as follows. Namely, as this correction technique corrects defect based on normal pixels present around a defective portion, in case the image has a complicated boundary due to presence of a complicated pattern or image edge or the like therein, it is difficult to judge the presence of such image boundary, based solely on the normal pixels present about the defective portion. As a result, accurate correction of defective portion is difficult. Especially, when the defective portion has a large area, the possibility of presence of such complicated boundary or pattern is high. So, accurate correction is difficult.